<template>
    <div>
        <van-nav-bar title="详情" left-text="返回" left-arrow @click-left="onClickLeft" />
         <van-skeleton title :row="3" v-if="status"/>
         <van-tabs v-model:active="active">
            <van-tab title="商品详情">内容 1</van-tab>
            <van-tab title="规格参数">内容 2</van-tab>
            <van-tab title="销售数据">内容 3</van-tab>
            <van-tab title="采购说明">内容 4</van-tab>
        </van-tabs>
        <div v-html="detail.goods_introduce"></div>
        <van-action-bar>
            <van-action-bar-icon icon="chat-o" text="客服" @click="onClickIcon" />
            <van-action-bar-icon icon="cart-o" text="购物车" @click="onClickIcon" />
            <van-action-bar-icon icon="shop-o" text="店铺" @click="onClickIcon" />
            <van-action-bar-button type="danger" text="立即购买" @click="onClickButton" />
        </van-action-bar>
        <van-swipe :autoplay="3000" lazy-render>
            <van-swipe-item v-for="image in images" :key="image">
                <img :src="image" style="width: 100%;height: 200px;" />
            </van-swipe-item>
        </van-swipe>
       
    </div>
</template>

<script setup>
import { ref } from 'vue';
import { detailApi } from '@/api/api'
import { useRoute } from 'vue-router';
let detail = ref([])
let router = useRoute();
detailApi(router.params.goods_id).then(res => {
    console.log('详情数据', res);
    detail.value = res.data.message
})
const images = [
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-4.jpeg',
];
let status=ref(true)
setTimeout(()=>{
    status.value=false
},5000)
</script>

<style lang="scss" scoped></style>